var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(f, c, b) {
    if (status == 0 && f == 0) {
        cm.dispose();
        return
    }(f == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (cm.isQuestActive(41267)) {
                var e = cm.getNumberFromQuestCustomData(41271);
                if (e == 0) {
                    cm.sendNormalTalk("按照琦尼的设计图，画了1次魔法阵。", 0, 2460014, false, true);
                    cm.forceStartQuest(41271, "1")
                } else {
                    if (e == 1) {
                        cm.sendNormalTalk("按照琦尼的设计图，画了2次魔法阵。", 0, 2460014, false, true);
                        cm.forceStartQuest(41271, "2")
                    } else {
                        if (e == 2) {
                            cm.sendNormalTalk("按照琦尼设计图，完成了魔法阵。", 0, 2460014, false, true);
                            cm.forceStartQuest(41271, "3");
                            cm.updateInfoQuest(41267, "clear=clear")
                        } else {
                            cm.sendNormalTalk("按照琦尼设计图，完成了魔法阵。", 0, 2460014, false, true)
                        }
                    }
                }
            } else {
                cm.sendOk("#b（一个练习用的魔法阵）")
            }
        } else {
            cm.dispose()
        }
    }
};